package com.evon.yardmanagement.exception;

/**
 * A custom exception for yard management application.
 * 
 * @author vgaurav
 * 
 */
public class YardManagementException extends RuntimeException {

	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	private Exception wrappedException;

	private ExceptionType type;

	public enum ExceptionType {
		RECOVERABLE, NON_RECOVERABLE

	}

	public YardManagementException(Exception ex, ExceptionType type) {
		this.wrappedException = ex;
		this.type = type;

	}

	public Throwable getCause() {
		return wrappedException.getCause();
	}

	public String getLocalizedMessage() {
		return wrappedException.getLocalizedMessage();
	}

	public String getMessage() {
		return wrappedException.getMessage();
	}

	public ExceptionType getType() {
		return type;
	}

	public void setType(ExceptionType type) {
		this.type = type;
	}

}
